home *** CD-ROM | disk | FTP | other *** search
- package java.awt;
-
- import java.awt.image.ColorModel;
- import java.awt.image.ImageObserver;
- import java.awt.image.ImageProducer;
- import java.awt.peer.ComponentPeer;
- import java.io.PrintStream;
- import java.io.Serializable;
-
- public abstract class Component implements ImageObserver, Serializable {
- transient ComponentPeer peer;
- transient Container parent;
- // $FF: renamed from: x int
- int field_0;
- // $FF: renamed from: y int
- int field_1;
- int width;
- int height;
- Color foreground;
- Color background;
- Font font;
- boolean visible = true;
- boolean enabled = true;
- boolean valid = false;
- String name;
- static final Object LOCK = new Object();
-
- Component() {
- }
-
- public Container getParent() {
- return this.parent;
- }
-
- public ComponentPeer getPeer() {
- return this.peer;
- }
-
- public Toolkit getToolkit() {
- ComponentPeer var1 = this.peer;
- if (var1 != null) {
- return var1.getToolkit();
- } else {
- Container var2 = this.parent;
- return var2 != null ? ((Component)var2).getToolkit() : Toolkit.getDefaultToolkit();
- }
- }
-
- public boolean isValid() {
- return this.peer != null && this.valid;
- }
-
- public boolean isVisible() {
- return this.visible;
- }
-
- public boolean isShowing() {
- if (this.visible && this.peer != null) {
- Container var1 = this.parent;
- return var1 == null || ((Component)var1).isShowing();
- } else {
- return false;
- }
- }
-
- public boolean isEnabled() {
- return this.enabled;
- }
-
- public Point location() {
- return new Point(this.field_0, this.field_1);
- }
-
- public Dimension size() {
- return new Dimension(this.width, this.height);
- }
-
- public Rectangle bounds() {
- return new Rectangle(this.field_0, this.field_1, this.width, this.height);
- }
-
- public synchronized void enable() {
- if (!this.enabled) {
- this.enabled = true;
- if (this.peer != null) {
- this.peer.enable();
- }
- }
-
- }
-
- public void enable(boolean var1) {
- if (var1) {
- this.enable();
- } else {
- this.disable();
- }
- }
-
- public synchronized void disable() {
- if (this.enabled) {
- this.enabled = false;
- if (this.peer != null) {
- this.peer.disable();
- }
- }
-
- }
-
- public void setVisible(boolean var1) {
- this.show(var1);
- }
-
- public synchronized void show() {
- if (!this.visible) {
- this.visible = true;
- if (this.peer != null) {
- this.peer.show();
- if (this.parent != null) {
- this.parent.invalidate();
- }
- }
- }
-
- }
-
- public void show(boolean var1) {
- if (var1) {
- this.show();
- } else {
- this.hide();
- }
- }
-
- public synchronized void hide() {
- if (this.visible) {
- this.visible = false;
- if (this.peer != null) {
- this.peer.hide();
- if (this.parent != null) {
- this.parent.invalidate();
- }
- }
- }
-
- }
-
- public Color getForeground() {
- Color var1 = this.foreground;
- if (var1 != null) {
- return var1;
- } else {
- Container var2 = this.parent;
- return var2 != null ? ((Component)var2).getForeground() : null;
- }
- }
-
- public synchronized void setForeground(Color var1) {
- this.foreground = var1;
- if (this.peer != null) {
- var1 = this.getForeground();
- if (var1 != null) {
- this.peer.setForeground(var1);
- }
- }
-
- }
-
- public Color getBackground() {
- Color var1 = this.background;
- if (var1 != null) {
- return var1;
- } else {
- Container var2 = this.parent;
- return var2 != null ? ((Component)var2).getBackground() : null;
- }
- }
-
- public synchronized void setBackground(Color var1) {
- this.background = var1;
- if (this.peer != null) {
- var1 = this.getBackground();
- if (var1 != null) {
- this.peer.setBackground(var1);
- }
- }
-
- }
-
- public Font getFont() {
- Font var1 = this.font;
- if (var1 != null) {
- return var1;
- } else {
- Container var2 = this.parent;
- return var2 != null ? ((Component)var2).getFont() : null;
- }
- }
-
- public synchronized void setFont(Font var1) {
- this.font = var1;
- if (this.peer != null) {
- var1 = this.getFont();
- if (var1 != null) {
- this.peer.setFont(var1);
- }
- }
-
- }
-
- public synchronized ColorModel getColorModel() {
- return this.peer == null ? this.getToolkit().getColorModel() : this.peer.getColorModel();
- }
-
- public void move(int var1, int var2) {
- this.reshape(var1, var2, this.width, this.height);
- }
-
- public void resize(int var1, int var2) {
- this.reshape(this.field_0, this.field_1, var1, var2);
- }
-
- public void resize(Dimension var1) {
- this.reshape(this.field_0, this.field_1, var1.width, var1.height);
- }
-
- public synchronized void reshape(int var1, int var2, int var3, int var4) {
- boolean var5 = this.width != var3 || this.height != var4;
- if (var5 || this.field_0 != var1 || this.field_1 != var2) {
- this.field_0 = var1;
- this.field_1 = var2;
- this.width = var3;
- this.height = var4;
- if (this.peer != null) {
- this.peer.reshape(var1, var2, var3, var4);
- if (var5) {
- this.invalidate();
- }
-
- if (this.parent != null) {
- this.parent.invalidate();
- }
- }
- }
-
- }
-
- public Dimension preferredSize() {
- ComponentPeer var1 = this.peer;
- return var1 != null ? var1.preferredSize() : this.minimumSize();
- }
-
- public Dimension minimumSize() {
- ComponentPeer var1 = this.peer;
- return var1 != null ? var1.minimumSize() : this.size();
- }
-
- public void layout() {
- }
-
- public void validate() {
- while(!this.valid && this.peer != null) {
- this.layout();
- this.valid = true;
- }
-
- }
-
- public void invalidate() {
- this.valid = false;
- if (this.parent != null && this.parent.valid) {
- this.parent.invalidate();
- }
-
- }
-
- public Graphics getGraphics() {
- ComponentPeer var1 = this.peer;
- return var1 != null ? var1.getGraphics() : null;
- }
-
- public FontMetrics getFontMetrics(Font var1) {
- ComponentPeer var2 = this.peer;
- return var2 != null ? var2.getFontMetrics(var1) : this.getToolkit().getFontMetrics(var1);
- }
-
- public void paint(Graphics var1) {
- }
-
- public void update(Graphics var1) {
- var1.setColor(this.getBackground());
- var1.fillRect(0, 0, this.width, this.height);
- var1.setColor(this.getForeground());
- this.paint(var1);
- }
-
- public void paintAll(Graphics var1) {
- ComponentPeer var2 = this.peer;
- if (this.visible && var2 != null) {
- this.validate();
- var2.paint(var1);
- }
-
- }
-
- public void repaint() {
- this.repaint(0L, 0, 0, this.width, this.height);
- }
-
- public void repaint(long var1) {
- this.repaint(var1, 0, 0, this.width, this.height);
- }
-
- public void repaint(int var1, int var2, int var3, int var4) {
- this.repaint(0L, var1, var2, var3, var4);
- }
-
- public void repaint(long var1, int var3, int var4, int var5, int var6) {
- ComponentPeer var7 = this.peer;
- if (var7 != null && var5 > 0 && var6 > 0) {
- var7.repaint(var1, var3, var4, var5, var6);
- }
-
- }
-
- public void print(Graphics var1) {
- this.paint(var1);
- }
-
- public void printAll(Graphics var1) {
- ComponentPeer var2 = this.peer;
- if (this.visible && var2 != null) {
- this.validate();
- var2.print(var1);
- }
-
- }
-
- public boolean imageUpdate(Image var1, int var2, int var3, int var4, int var5, int var6) {
- int var7 = -1;
- if ((var2 & 48) != 0) {
- var7 = 0;
- } else if ((var2 & 8) != 0) {
- String var8 = System.getProperty("awt.image.incrementaldraw");
- if (var8 == null || var8.equals("true")) {
- String var9 = System.getProperty("awt.image.redrawrate");
-
- try {
- var7 = var9 != null ? Integer.parseInt(var9) : 100;
- if (var7 < 0) {
- var7 = 0;
- }
- } catch (Exception var10) {
- var7 = 100;
- }
- }
- }
-
- if (var7 >= 0) {
- this.repaint((long)var7, 0, 0, this.width, this.height);
- }
-
- return (var2 & 160) == 0;
- }
-
- public Image createImage(ImageProducer var1) {
- ComponentPeer var2 = this.peer;
- return var2 != null ? var2.createImage(var1) : this.getToolkit().createImage(var1);
- }
-
- public Image createImage(int var1, int var2) {
- ComponentPeer var3 = this.peer;
- return var3 != null ? var3.createImage(var1, var2) : null;
- }
-
- public boolean prepareImage(Image var1, ImageObserver var2) {
- return this.prepareImage(var1, -1, -1, var2);
- }
-
- public boolean prepareImage(Image var1, int var2, int var3, ImageObserver var4) {
- ComponentPeer var5 = this.peer;
- return var5 != null ? var5.prepareImage(var1, var2, var3, var4) : this.getToolkit().prepareImage(var1, var2, var3, var4);
- }
-
- public int checkImage(Image var1, ImageObserver var2) {
- return this.checkImage(var1, -1, -1, var2);
- }
-
- public int checkImage(Image var1, int var2, int var3, ImageObserver var4) {
- ComponentPeer var5 = this.peer;
- return var5 != null ? var5.checkImage(var1, var2, var3, var4) : this.getToolkit().checkImage(var1, var2, var3, var4);
- }
-
- public synchronized boolean inside(int var1, int var2) {
- return var1 >= 0 && var1 < this.width && var2 >= 0 && var2 < this.height;
- }
-
- public Component locate(int var1, int var2) {
- return this.inside(var1, var2) ? this : null;
- }
-
- public void deliverEvent(Event var1) {
- this.postEvent(var1);
- }
-
- public boolean postEvent(Event var1) {
- ComponentPeer var2 = this.peer;
- if (this.handleEvent(var1)) {
- return true;
- } else {
- Container var3 = this.parent;
- if (var3 != null) {
- var1.translate(this.field_0, this.field_1);
- if (((Component)var3).postEvent(var1)) {
- return true;
- }
- }
-
- return var2 != null ? var2.handleEvent(var1) : false;
- }
- }
-
- public boolean handleEvent(Event var1) {
- switch (var1.id) {
- case 401:
- case 403:
- return this.keyDown(var1, var1.key);
- case 402:
- case 404:
- return this.keyUp(var1, var1.key);
- case 501:
- return this.mouseDown(var1, var1.x, var1.y);
- case 502:
- return this.mouseUp(var1, var1.x, var1.y);
- case 503:
- return this.mouseMove(var1, var1.x, var1.y);
- case 504:
- return this.mouseEnter(var1, var1.x, var1.y);
- case 505:
- return this.mouseExit(var1, var1.x, var1.y);
- case 506:
- return this.mouseDrag(var1, var1.x, var1.y);
- case 1001:
- return this.action(var1, var1.arg);
- case 1004:
- return this.gotFocus(var1, var1.arg);
- case 1005:
- return this.lostFocus(var1, var1.arg);
- default:
- return false;
- }
- }
-
- public boolean mouseDown(Event var1, int var2, int var3) {
- return false;
- }
-
- public boolean mouseDrag(Event var1, int var2, int var3) {
- return false;
- }
-
- public boolean mouseUp(Event var1, int var2, int var3) {
- return false;
- }
-
- public boolean mouseMove(Event var1, int var2, int var3) {
- return false;
- }
-
- public boolean mouseEnter(Event var1, int var2, int var3) {
- return false;
- }
-
- public boolean mouseExit(Event var1, int var2, int var3) {
- return false;
- }
-
- public boolean keyDown(Event var1, int var2) {
- return false;
- }
-
- public boolean keyUp(Event var1, int var2) {
- return false;
- }
-
- public boolean action(Event var1, Object var2) {
- return false;
- }
-
- public void addNotify() {
- this.valid = false;
- }
-
- public synchronized void removeNotify() {
- if (this.peer != null) {
- this.peer.dispose();
- this.peer = null;
- }
-
- }
-
- public boolean gotFocus(Event var1, Object var2) {
- return false;
- }
-
- public boolean lostFocus(Event var1, Object var2) {
- return false;
- }
-
- public void requestFocus() {
- ComponentPeer var1 = this.peer;
- if (var1 != null) {
- var1.requestFocus();
- }
-
- }
-
- public void nextFocus() {
- ComponentPeer var1 = this.peer;
- if (var1 != null) {
- var1.nextFocus();
- }
-
- }
-
- protected String paramString() {
- String var1 = this.field_0 + "," + this.field_1 + "," + this.width + "x" + this.height;
- if (!this.valid) {
- var1 = var1 + ",invalid";
- }
-
- if (!this.visible) {
- var1 = var1 + ",hidden";
- }
-
- if (!this.enabled) {
- var1 = var1 + ",disabled";
- }
-
- return var1;
- }
-
- public String toString() {
- return this.getClass().getName() + "[" + this.paramString() + "]";
- }
-
- public void list() {
- this.list(System.out, 0);
- }
-
- public void list(PrintStream var1) {
- this.list(var1, 0);
- }
-
- public void list(PrintStream var1, int var2) {
- for(int var3 = 0; var3 < var2; ++var3) {
- var1.print(" ");
- }
-
- var1.println(this);
- }
- }
-